package com.tianpengtech.common.model.moneylog;

import com.tianpengtech.common.model.AbstractBaseModel;

/**
 * 实体类名-网红收益纪录表 fair_wh_moneylog
 *
 * @since Thu Jul 20 21:03:16 CST 2017
 */
public class MoneyLog extends AbstractBaseModel<MoneyLog> {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	public static final MoneyLog dao = new MoneyLog();

	public static final String ID = "id"; //
	public static final String WH_ID = "wh_id"; // 网红ID
	public static final String CREATE_TIME = "create_time"; // 创建时间
	public static final String MONEY = "money"; // 金额
	public static final String DELETETAG = "deletetag"; // 删除标识
	public static final String DESCRIPTION = "description"; // 描述
	public static final String TYPE = "type"; // 类型
	public static final String OPERID = "operid"; // 关联ID
	public static final String STATE = "state"; // 金额增加还是减少

	public static final Integer TYPE_TIXIAN = 1; // 提现 operid=提现表ID
	public static final Integer TYPE_YAOQING = 2; // 邀请 operid=被邀请用户ID
	public static final Integer TYPE_RENWU = 3; // 任务 operid=任务ID

	public static final Integer STATE_ADD = 1; // 金额增加
	public static final Integer STATE_REDUCE = 2; // 金额减少

	
	public static final int STATUS_APPROVING=0;
	public static final int STATUS_SUCCESS=1;
	public static final int STATUS_ERROR=2;
	
	@Override
	public String tableName() {
		return "fair_wh_moneylog";
	}
	
	
	public String type(){
		
		String value="";
		if(getInt(TYPE)==TYPE_TIXIAN){
			value="提现";
		}else if(getInt(TYPE)==TYPE_YAOQING){
			value="邀请";
		}else if(getInt(TYPE)==TYPE_RENWU){
			value="任务";
		}else{
			value="未知";
		}
		return value;
	}
	
	
	public String status(){
		
		String value="等待审核";
		if(getInt(DELETETAG)==STATUS_SUCCESS){
			value="审核通过";
		}else if(getInt(DELETETAG)==STATUS_ERROR){
			value="审核不通过";
		}
		return value;
	}

}